<template>
  <div>
    <el-menu :default-active="activeIndex" class="el-menu-demo" mode="vertical" @select="handleSelect">
      <el-menu-item index="1">处理中心</el-menu-item>
      <el-submenu index="2">
        <template slot="title">我的工作台</template>
        <el-menu-item index="2-1">选项1</el-menu-item>
        <el-menu-item index="2-2">选项2</el-menu-item>
        <el-menu-item index="2-3">选项3</el-menu-item>
        <el-submenu index="2-4">
          <template slot="title">选项4</template>
          <el-menu-item index="2-4-1">选项1</el-menu-item>
          <el-menu-item index="2-4-2">选项2</el-menu-item>
          <el-menu-item index="2-4-3">选项3</el-menu-item>
        </el-submenu>
      </el-submenu>
      <el-menu-item index="3" disabled>消息中心</el-menu-item>
      <el-menu-item index="4"><a href="https://www.ele.me" target="_blank">订单管理</a></el-menu-item>
    </el-menu>


    <childOne></childOne>
    <childTwo></childTwo>

    <el-tabs v-model="activeName"  @contextmenu.native="handleContextmenu">
      <el-tab-pane label="用户管理" name="first">用户管理</el-tab-pane>
      <el-tab-pane label="配置管理" name="second">配置管理</el-tab-pane>
      <el-tab-pane label="角色管理" name="third">角色管理</el-tab-pane>
      <el-tab-pane label="定时任务补偿" name="fourth">定时任务补偿</el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import childOne from "@/components/collapseMenu/childOne";
import childTwo from "@/components/collapseMenu/childTwo";
export default {
  name: "collapseMenu",
  provide() {
    return {
      ParentData: this
    };
  },
  components: {childOne,childTwo},
  created(){
    // console.log("A页面执行触发的方法")
  },
  data(){
    return{
      activeIndex: '1',
      activeName:'first'
    }
  },
  methods:{
    handleSelect(key, keyPath) {
      console.log("key:",key,"keyPath:",keyPath)
    },
    handleContextmenu(event){
      console.log("event:",event)
    }
  }
}
</script>

<style scoped>

</style>